<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'frontend.main.class.php');
$feObj = new FrontendMainBase();

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/page/page.class.php');
$mObj = new PageBase();
$mObj->format = true;
$page = $mObj->getItem('home', 'link');
$feObj->addInject('page', $page);

//
$page = $mObj->getItem('home-contact_page', 'link');
$feObj->addInject('contact_page', $page);

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/news/news.class.php');
$mObj = new NewsBase();
$mObj->format = true;
$mObj->setQueryLimitLength(6);
$items = $mObj->getItems('', 0);
$feObj->content_wrap['news_items'] = $items;

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/content/content.class.php');
$mObj = new ContentBase();
$mObj->format = true;
$mObj->setQueryLimitLength(6);
$filter = array('cid' => 5, 'flag_recommend:=' => '1');
$items = $mObj->getItems($filter, 0);
$feObj->content_wrap['related_items'] = $items;

//
$feObj->addCssFile('h.css');
echo $feObj->display('pagelayout/pagelayout_main_home.tpl');
//
?>